home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Collection of Tools & Utilities
/
Collection of Tools and Utilities.iso
/
clipper
/
nftroff.zip
/
7.tr
< prev
next >
Wrap
Text File
|
1991-11-21
|
18KB
|
1,228 lines
.de }n
.bp
.sp .5i
..
.wh -.8i }n
.sp .5i
.po -.4i
.ll 7.5i
.ps 9
.vs 9
.in 0i
.ta 1.63265i
.sp 2
.ne 20
.ps +3
.vs +3
FT_DFCLOSE() Close file displayed by FT_DISPFILE()
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_DFCLOSE()
Close file displayed by FT_DISPFILE()
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_DFCLOSE() -> NIL
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
None
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
NIL
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
Closes the file opened by FT_DFSETUP()
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
@ 4,9 TO 11,71
.sp
FT_DFSETUP("test\.txt", 5, 10, 10, 70, 1, 7, 15,;
.in 1.36i
"AaBb" + Chr(143), \.T\., 5, 132, 4096)
.sp
.in 0.4i
cKey = FT_DISPFILE()
.sp
FT_DFCLOSE()
.sp
@ 20,0 SAY "Key that terminated FT_DISPFILE() was: " + \'[\' + cKey + \']\'
.sp
.in 0.08i
\fBSource:\fR DFILE\.PRG
.sp
\fBAuthor:\fR Mike Taylor
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_DFSETUP()
, FT_DISPFILE()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_DFSETUP() Set up parameters for FT_DISPFILE()
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_DFSETUP()
Set up parameters for FT_DISPFILE()
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
.br
\fBFT_DFSETUP( <cInFile>, <nTop>, <nLeft>, <nBottom>, <nRight>, ;
.in 1.12i
.ta 4.16i
.br
\fB<nStart>, <nCNormal>, <nCHighlight>, <cExitKeys>, ;
.br
.ta
.br
\fB<lBrowse>, <nColSkip>, <nRMargin>, <nBuffSize> ) -> nResult
.sp
.in 0.08i
\fBArguments
.sp
.in 0.64i
.ta 1.12i
\fB<cInFile>\fR - text file to display (full path and filename)
.br
.ta
.ta 1.12i
\fB<nTop>\fR - upper row of window
.br
.ta
.ta 1.12i
\fB<nLeft>\fR - left col of window
.br
.ta
.ta 1.12i
\fB<nBottom>\fR - lower row of window
.br
.ta
.ta 1.12i
\fB<nRight>\fR - right col of window
.br
.ta
.ta 1.12i
\fB<nStart>\fR - line to place highlight at startup
.br
.ta
.ta 1.12i 3.04i
\fB<nCNormal>\fR - normal text color (numeric attribute)
.br
.ta
.ta 3.04i
\fB<nCHighlight>\fR - text highlight color (numeric attribute)
.br
.ta
.ta 1.12i 3.04i
\fB<cExitKeys>\fR - terminating key list (each byte of string is a
.br
.ta
.in 1.92i
key code)
.in 0.64i
.ta 1.12i
\fB<lBrowse>\fR - act-like-a-browse-routine flag
.br
.ta
.ta 1.12i
\fB<nColSkip>\fR - col increment for left/right arrows
.br
.ta
.ta 1.12i
\fB<nRMargin>\fR - right margin - anything to right is truncated
.br
.ta
.ta 1.12i
\fB<nBuffSize>\fR - size of the paging buffer
.br
.ta
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
0 if successful, FError() code if not
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
Note: make sure you allocate a buffer large enough to hold enough
data for the number of lines that you have in the window\. Use the
following formula as a guideline:
.sp
.in 0.64i
buffer size = (# of line) + 1 * RMargin
.sp
.in 0.4i
This is the smallest you should make the buffer\. For normal use,
4096 bytes is recommended
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
@ 4,9 TO 11,71
.sp
FT_DFSETUP("test\.txt", 5, 10, 10, 70, 1, 7, 15,;
.in 1.28i
"AaBb" + Chr(143), \.T\., 5, 132, 4096)
.sp
.in 0.4i
cKey = FT_DISPFILE()
.sp
FT_DFCLOSE()
.sp
@ 20,0 SAY "Key that terminated FT_DISPFILE() was: " + \'[\' + cKey + \']\'
.sp
.in 0.08i
\fBSource:\fR DFILE\.PRG
.sp
\fBAuthor:\fR Mike Taylor
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_DISPFILE()
, FT_DFCLOSE()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_DISPFILE() Browse a text file
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_DISPFILE()
Browse a text file
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_DISPFILE() -> cExitkey
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
None
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
The ASCII keystroke that terminated FT_DISPFILE()
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
This routine displays a text file within a defined window using as
little memory as possible\. The text file to display has to be
present or an error value of 0 is returned (as a character\.)
.sp
Assumptions: The routine assumes that all lines are terminated
.in 1.44i
with a CR/LF sequence (0x0d and 0x0a)\.
.sp
.in 0.4i
.ta 1.04i
Note: Make sure you allocate a buffer large enough to hold
.br
.ta
.in 1.44i
enough data for the number of lines that you have
in the window\. Use the following formula as a
guideline - buffer size = (# of line) + 1 * RMargin
this is the smallest you should make the buffer and
for normal use I recommend 4096 bytes\.
.sp
.in 0.4i
.ta 2i
Cursor Keys: Up, Down - moves the highlight line
.br
.ta
.in 1.44i
Left, Right - moves the window over nColSkip col\'s
.ta 0.96i
Home - moves the window to the far left
.br
.ta
.ta 0.96i
End - moves the window to the nRMargin column
.br
.ta
.ta 0.96i
PgUp, PgDn - moves the highlight one page
.br
.ta
.ta 0.96i
Ctrl-PgUp - moves the highlight to the file top
.br
.ta
.ta 0.96i
Ctrl-PgDn - moves the highlight to the file bottom
.br
.ta
.ta 0.96i
Ctrl-Right - moves the window 16 col\'s to the right
.br
.ta
.ta 0.96i
Ctrl-Left - moves the window 16 col\'s to the left
.br
.ta
.sp
Esc, Return - terminates the function
.sp
All other keys are ignored unless they are specified
within cExitKeys parameter\. This list will tell the
routine what keys terminate the function\. Special
keys must be passed by a unique value and that value
can be found by looking in the keys\.h file\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
@ 4,9 TO 11,71
.sp
FT_DFSETUP("test\.txt", 5, 10, 10, 70, 1, 7, 15,;
.in 1.36i
"AaBb" + Chr(143), \.T\., 5, 132, 4096)
.sp
.in 0.4i
cKey = FT_DISPFILE()
.sp
FT_DFCLOSE()
.sp
@ 20,0 SAY "Key that terminated FT_DISPFILE() was: " + \'[\' + cKey + \']\'
.sp
.in 0.08i
\fBSource:\fR DISPC\.C
.sp
\fBAuthor:\fR Mike Taylor
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_DFSETUP()
, FT_DFCLOSE()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_FEOF() Determine when end of text file is encountered
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_FEOF()
Determine when end of text file is encountered
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_FEOF() -> lResult
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
None
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
\.T\. if an attempt was made to skip past the last record of
the currently selected text file, otherwise \.F\.
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
This function is similar to the CLIPPER Eof() function\.
.sp
A text file "record" is a line of text terminated by a CRLF pair\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
.br
FT_FUSE( "FTTEXT\.C" )
.br
FT_FGOBOT()
.ta 1.52i
.br
? FT_FEOF() // \.F\.
.br
.ta
.br
FT_FSKIP()
.ta 1.52i
.br
? FT_FEOF() // \.T\.
.br
.ta
.sp
.in 0.08i
\fBSource:\fR FTTEXT\.C
.sp
\fBAuthor:\fR Brice de Ganahl
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_FUSE()
, FT_FGOBOT()
, FT_FSKIP()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_FGOBOT() Go to the last record in a text file
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_FGOBOT()
Go to the last record in a text file
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_FGOBOT() -> NIL
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
None
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
NIL
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
This function moves the record pointer to the last record of the
file in the currently selected text file workarea\.
.sp
A text file "record" is a line of text terminated by a CRLF pair\.
.sp
.in 0.08i
\fBExamples
.sp
.in 0.4i
.br
// read last line
.br
FT_FUSE( "text\.c" )
.br
FT_FGOBOT()
.br
? FT_FREADLN()
.sp
.in 0.08i
\fBSource:\fR FTTEXT\.C
.sp
\fBAuthor:\fR Brice de Ganahl
.in 0i
.sp
.in 1.5i
.ti -1.5i
.ta 1.5i
.ft B
See Also:
.ft R
FT_FSELECT()
, FT_FUSE()
, FT_FGOTOP()
, FT_FRECNO()
, FT_FREADLN()
.ta 1.63265i
.in 0i
.sp 2
.ne 20
.ps +3
.vs +3
FT_FGOTO() Move record pointer to specific record in a text file
.br
.ta
.in 0.08i
.ps -3
.vs -3
.sp 2
\fBFT_FGOTO()
Move record pointer to specific record in a text file
.in 0i
.br
\l'6.24i'
.br
.sp
.in 0.08i
\fBSyntax
.sp
.in 0.4i
\fBFT_FGOTO( nLine ) -> NIL
.sp
.in 0.08i
\fBArguments
.sp
.in 0.4i
\fB<nLine>\fR is the record number to go to\.
.sp
.in 0.08i
\fBReturns
.sp
.in 0.4i
NIL
.sp
.in 0.08i
\fBDescription
.sp
.in 0.4i
This function moves the record pointer to a specific record
in the fi